package com.sntk.organauthomanager.infrastructure.db.repository;

import com.sntk.organauthomanager.infrastructure.db.entity.UserRoleEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @ClassName: UserRoleDBRepository
 * @author: wgchao
 * @createTime: 2020/7/21 6:05 PM
 * @Description: TODO
 */
@Repository
public interface UserRoleDBRepository extends JpaRepository<UserRoleEntity, Long>, JpaSpecificationExecutor<UserRoleEntity> {
    List<UserRoleEntity> findAllByUname(String uname);
    List<UserRoleEntity> findAllByUnameAndInstitutionNumber(String uname, String institutionNumber);
    void deleteAllByRoleCodeAndInstitutionNumber(String roleCode, String institutionNumber);
    void deleteAllByUname(String uname);
}